/*
 * ===================================================
 *
 *       Filename:  parse_trace.h
 *
 *       Version:  1.0
 *       Created:  10/20/2011 03:38:56 PM
 *       Compiler:  gcc
 *
 *       Author:  durand_y, <yoan.durand@gmail.com>
 *
 * ===================================================
 */
#ifndef PARSER_H_
# define PARSER_H_

# include <unistd.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <fcntl.h>
# include "tools.h"
# include "constants.h"
# include "car.h"
# include "../arithmetic/fixed_point.h"

/**
** @fn int parse_trace(char    *trace);
** @return int
** @brief This function parse trace.
*/
int         parse_trace(char    *trace);

/**
** @fn int parse_track(char    *file);
** @return int
** @brief This function parse track.
*/
int         parse_track(char    *file);

/**
** @fn void  error(int err,int pos1,int pos2);
** @return void
** @brief This function print error.
*/
void        error(int           err,
                  int           pos1,
                  int           pos2);

/**
** @fn s_car *run_trace(char *trace,s_car *car,char **map);
** @return s_car
** @brief This function run-trace.
*/
s_car       *run_trace(char     *trace,
                       s_car    *car,
                       char     **map);

/**
** @fn char **create_map(char    *file);
** @return Char **
** @brief This function create map.
*/
char        **create_map(char    *file);

void        start_pos(s_car     **car,
                      char      **map);
void        finish(s_car        *car);

int         is_height_eq(char   *line,
                         char   *parse,
                         int    *i,
                         int    height,
                         int    width);
#endif /* !PARSER_H_ */
